<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="ax" uri="http://peru.org.muni" %>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
     <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<title></title>
<script type="text/javascript">

function asignaAccion(accClic){
	if(accClic.name =="btnConsultar"){
		document.formATec.operacion.value="consultaTecnico";
		document.formATec.action="SolServlet.do";
	
	}else if(accClic.name =="btnAsignar"){
	document.formATec.operacion.value="asignaTecnico";
	document.formATec.action="SolServlet.do";
	}
	document.formATec.submit();

	}
function deshabilitaBoton(){
	document.forms[0].btnAsignar.disabled=true;	
}
</script>
</head>
<body >
<form name="formATec" method="post" action="">
  <table border="2" cellpadding="8">
    <tr bgcolor="#FF6600">
      <td colspan="3" class="HeaderColor">
       
        <h4><fmt:message key="cu032.titRegistro" /></h4>
        
      </td>
    </tr>
	<tr bgcolor="#C0C0C0">
      <td colspan="3" class="HeaderColor">
        <fmt:message key="cu032.titDatos" />    
      </td>
    </tr>

    <tr >
      <td bgcolor="#DDDDDD" width="12%" nowrap class="LabelColor" style="text-align: right">
        <label for="codsol"> <fmt:message key="cu032.codSol" /></label>
      </td>
      <td bgcolor="#DDDDDD" colspan="2" class="TitleColor">
        <input type="text" id="codsol" name="codsol" size="35" readonly="readonly" value="${sessionScope.codigoSolicitudAprob}">
        <br>
      </td>
    </tr>
    <tr style="vertical-align: top">
      <td bgcolor="#DDDDDD" style="text-align: right" class="LabelColor">
        <label for="nomcont"><fmt:message key="cu032.nomCont" /> </label>
      </td>
      <td bgcolor="#DDDDDD" colspan="2" class="TitleColor">
        <input type="text" id="nomcont" name="nomcont" size="35" readonly="readonly" value="${sessionScope.nombreCompContribuyenteAprob}"></input>
      </td>
    </tr>
    <tr  style="vertical-align: top">
      <td bgcolor="#DDDDDD" style="text-align: right" class="LabelColor">
        <label for="estreq"><fmt:message key="cu032.estadoReq" /></label>
      </td>
      <td bgcolor="#DDDDDD" colspan="2" class="TitleColor">
        <input type="text" id="estreq" name="estreq" size="35" readonly="readonly" value="Aprobados">
      </td>
    </tr>
	<tr bgcolor="#C0C0C0">
      <td colspan="3"  class="HeaderColor" > 
       <fmt:message key="cu032.titDatos" /> 
      </td>
    </tr>
    <tr style="vertical-align: top">
      <td bgcolor="#DDDDDD" style="text-align: right" class="LabelColor">
        <label for="codtec"><fmt:message key="cu032.tecnAct" /> </label>
      </td>
      <td bgcolor="#DDDDDD" width="45%" class="TitleColor">
      <c:if test="${requestScope.tecnico != null}">
      	<select name="cboTecnicos" onchange="deshabilitaBoton();">
      	<c:forEach var="tec" items="${sessionScope.listatecnicos}">
      	<c:if test="${tec.strCodigo == requestScope.tecnico}">
      	<option selected="selected" value="${tec.strCodigo}">${tec.strNombre} ${tec.strApePat} ${tec.strApeMat}</option>
      	</c:if>
      	<c:if test="${tec.strCodigo != requestScope.tecnico}">
      	<option value="${tec.strCodigo}">${tec.strNombre} ${tec.strApePat} ${tec.strApeMat}</option>
      	</c:if>
      	</c:forEach>
      	</select>
      </c:if>
        <c:if test="${requestScope.tecnico == null}">
      <ax:comboTecnicos nombre="cboTecnicos"/>
      </c:if>
      </td>
	  <td bgcolor="#DDDDDD" width="55%" class="TitleColor">
	  	<input type="button" id="btnConsultar" name="btnConsultar" value=<fmt:message key="cu032.btnConsultar" /> onclick="asignaAccion(this)">
	  </td>
    </tr>
	<tr bgcolor="#C0C0C0">
      <td colspan="3" class="HeaderColor">  
        <fmt:message key="cu032.titSolAsig" />    
      </td>
    </tr>
    <tr bgcolor="#DDDDDD" style="vertical-align: top">
 		<td colspan="3">
		<table width="700" border="3" id="tbLiq">
  <tr bgcolor="00D0E8">
  	<th scope="col"><div align="center"><em><strong><fmt:message key="cu032.tblCodSol" /> </strong></em></div></th>
    <th scope="col"><div align="center"><em><strong><fmt:message key="cu032.tblNomCont" />  </strong></em></div></th>
    <th scope="col"><div align="center"><em><strong><fmt:message key="cu032.tblFechaAsig" />  </strong></em></div></th>
    <th scope="col"><div align="center"><em><strong><fmt:message key="cu032.tblEstadoInf"/>  </strong></em></div></th>
  </tr>
   <c:if test="${requestScope.listaSolicitudesAsignadas!=null}">
   <c:forEach var="sol" items="${requestScope.listaSolicitudesAsignadas}" varStatus="st" >
  <tr bgcolor="#FFFFFF">
    <td>${sol.strCodSol} </td>
    <c:if test="${sol.strRazSocContrib!=null}">
    <td>${sol.strRazSocContrib}</td>
    <td>${sol.dtFcAsignaTec}</td>
    <td>${sol.strEstadoInforme}</td>
    </c:if>
     <c:if test="${sol.strRazSocContrib==null}">
    <td>${sol.strNombreContrib} ${sol.strApelliPatContrib} ${strApelliMatContrib}</td>
    <td>${sol.dtFcAsignaTec}</td>
   	<td>${sol.strEstadoInforme}</td>
    </c:if>
  </c:forEach>
  </c:if>
</table>
		</td>
    </tr>
    <tr bgcolor="#DDDDDD" style="vertical-align: top" class="LabelColor" >
	   <td colspan="3" align="center">
	   <c:if test="${requestScope.listaSolicitudesAsignadas==null}">
	  	<input align="middle" type="button" disabled="disabled" id="btnAsignar" name="btnAsignar" value=<fmt:message key="cu032.btnAsignarSolicitud"/>  onclick=asignaAccion(this);>
	  </c:if>
	  <c:if test="${requestScope.listaSolicitudesAsignadas!=null}">
	  	<input align="middle" type="button"id="btnAsignar" name="btnAsignar" value="ASIGNAR SOLICITUD A T&Eacute;CNICO" onclick=asignaAccion(this);>
	  </c:if>
	  </td>
    </tr>
  </table>
    <input type="hidden" name="operacion">
</form>
</body>
</html>
    